<!DOCTYPE html>
<html lang="en">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
      name="viewport">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<title>区域总监、销售总监、总经理、区域支持、销售管理，意向客户列表new</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/dist/css/oa-app.css">
<head>

</head>
<style>
    .table-bordered {
        border-bottom: 1px solid #cbcbcd;
        border-top-width: 0px !important;
    }
    .slide-box {
        display: -webkit-box;
        overflow-x: scroll;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        height: 45px;
        line-height: 45px;
        background: #2a8cec;
        float: left;
        padding-left: 25px;
        width: 100%;
        position: fixed;
        top: 0;
    }
    .lineOne, .lineTwo {
        text-align: left;
    }
    .lineOne span {
        max-height: 24px;
        line-height: 24px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        text-align: left;
    }
    .div-td-content-more {
        position: absolute;
        height: auto;
        z-index: 999;
        line-height: 20px;
        background-color: #d3e8fd;
        padding: 8px 6px;
        border: 1px solid #e8e8ea;
        display: none;
    }
    .div-td-content-more i {
        width: 15px;
        height: 12px;
        /* background: url("/dist/img/more-icon.png");*/
        position: absolute;
        left: 50px;
        top: -12px;
    }
    .hidden {
        display: none;
    }
    .model-picker-dropdown {
        position: absolute;
        width: 315px;
        left: -9999px;
        top: -9999px;
        outline: 0;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
        z-index: 999999;
        display: none;
        min-width: 200px;
        margin-bottom: 20px;
        margin-top: 5px
    }

    .model-select-wrap {
        box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5)
    }

    .model-select-tab {
        border-bottom: 1px solid #ccc;
        background: #f5f5f5;
        font-size: 13px
    }

    .model-select-tab > a {
        display: inline-block;
        padding: 4px 20px;
        border-left: 1px solid #ccc;
        border-bottom: 1px solid transparent;
        color: #4D4D4D;
        text-align: center;
        outline: 0;
        text-decoration: none;
        cursor: pointer;
        font-size: 14px;
        margin-bottom: -1px
    }

    .model-select-tab > a.active {
        background: #fff;
        border-bottom: 1px solid #fff;
        color: #46A4FF
    }

    .model-select-tab > a:first-child {
        border-left: none
    }

    .model-select-tab > a:last-child.active {
        border-right: 1px solid #ccc
    }

    .model-select-content {
        width: 100%;
        min-height: 50px;
        background-color: #fff;
        padding: 5px 5px
    }

    .model-select {
        font-size: 12px
    }

    .model-select dl {
        line-height: 2;
        clear: both;
        padding: 3px 0;
        margin: 0;
        max-height: 200px;
        overflow-y: scroll
    }

    .model-select dt {
        position: absolute;
        width: 2.5em;
        font-weight: 500;
        text-align: right;
        line-height: 2
    }

    .model-select dd {
        margin-left: 0;
        line-height: 2
    }

    .model-select.province dd {
        margin-left: 3em
    }

    .model-select a {
        display: inline-block;
        padding: 0 10px;
        outline: 0;
        white-space: nowrap;
        margin-right: 2px;
        text-decoration: none;
        color: #333;
        cursor: pointer
    }

    .model-select a:hover, .model-select a:focus {
        background-color: #f1f8ff;
        border-radius: 2px;
        color: #46A4FF
    }

    .model-select a.active {
        background-color: #46A4FF;
        color: #fff;
        border-radius: 2px
    }
    .div-td-content-more {
        position: absolute;
        height: auto;
        z-index: 999;
        line-height: 20px;
        background-color: #d3e8fd;
        padding: 8px 6px;
        border: 1px solid #e8e8ea;
        display: none;
    }

    .div-td-content-more i {
        width: 15px;
        height: 12px;
        background: url("/dist/img/more-icon.png");
        position: absolute;
        left: 50px;
        top: -12px;
    }
    .lefts {
        text-align: center;
        color: #2a8cec;
        background-image: url(/dist/img/tabApp.png);
        margin-left: 8px;
        margin-right: 8px;
        font-size: 16px;
        background-size: 100% 100%;
        padding: 10px 15px 15px;
    }
    .rights {
        text-align: center;
        color: #fff;
        font-size: 14px;
        /*border-bottom: 2px solid #f8f8f8;*/
        margin-left: 4px;
        margin-right: 4px;
        margin-top: 3px;
        padding-bottom: 5px;
    }
</style>
<body>
<div id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>

    <div class="oa-tab">
        <div class="oa-tab-left"></div>
        <div class="oa-tab-middle">
            <span :class="buyDate=='本月内'?'tabActive':'tabNo'" @click="buyDate ='本月内';get_customerList_regionManager()" style="width: 20%">
               本月内
            </span>
                <span :class="buyDate=='下月内'?'tabActive':'tabNo'" @click="buyDate ='下月内';get_customerList_regionManager()" style="width: 20%">
               下月内
            </span>
                <span :class="buyDate=='三月内'?'tabActive':'tabNo'" @click="buyDate ='三月内';get_customerList_regionManager()" style="width: 20%">
               三月内
            </span>
                <span :class="buyDate=='半年内'?'tabActive':'tabNo'" @click="buyDate ='半年内';get_customerList_regionManager()" style="width: 19%">
               半年内
            </span>
                <span :class="buyDate=='全部'?'tabActive':'tabNo'" style="width: 19%" @click="buyDate ='全部';getAll()">
               全部
            </span>
        </div>
    </div>

    <!--本月目标完成情况-->
    <table class="oa-table " v-if="buyDate=='目标'" style="margin-top: 55px">
        <thead>
        <tr class="oa-table-title">
            <th>本月目标及完成情况</th>
        </tr>
        </thead>
    </table>
    <table class="oa-table " v-if="buyDate=='目标'">
        <thead>
        <tr class="oa-table-title-gray">
            <td  style="width:13%;background-color: #f8f8f8;border-top:none;">大区</td>
            <td  style="width: 17%;background-color: #f8f8f8;border-top:none;">姓名</td>
            <td  style="width: 20%;background-color: #f8f8f8;border-top:none;">考核周期</td>
            <td  style="width: 10%;background-color: #f8f8f8;border-top:none;">目标</td>
            <td  style="width: 15%;line-height:16px;background-color: #f8f8f8;border-top:none;">本月内<br>意向</td>
            <td  style="width: 12%;background-color: #f8f8f8;border-top:none;">已完成</td>
            <td  style="width: 13%;line-height:16px;background-color: #f8f8f8;border-top:none;">完成<br>概率</td>
        </tr>
        </thead>
        <tbody>
        <tr v-for="(item,i) in listTarget">
            <template v-if="item.roleName=='区域经理'">
                <td class="lineOne" :rowspan="item.regionNamespan"
                    :class="{hidden: item.regionNamedis}"><span
                        style="text-align: center;">{{item.regionName.replace(/大区/g,'')}}</span>
                </td>
                <td class="lineOne">
                    <span style="text-align: center;">{{item.userName}}</span>
                </td>
                <td>
                    {{Number(item.beginMonth.substring(5))}}、{{Number(item.middleMonth.substring(5))}}、{{Number(item.endMonth.substring(5))}}月
                </td>
                <td>{{item.saleTargetNum}}</td>
                <td>{{item.count}}</td>
                <td>{{item.saleFinishNum}}</td>
                <td>{{Math.floor(item.probability)}}%</td>
            </template>
            <template v-else>
                <td class="lineOne" :rowspan="item.regionNamespan"
                    :class="{hidden: item.regionNamedis}">
                    <span>{{item.regionName}}</span></td>
                <td class="lineOne" style="background: #F8F8F8;">
                    <span style="text-align: center;">{{item.userName}}</span>
                </td>
                <td style="background: #F8F8F8;">
                    {{Number(item.beginMonth.substring(5))}}月
                </td>
                <td style="background: #F8F8F8;">{{item.saleTargetNum}}</td>
                <td style="background: #F8F8F8;">{{item.count}}</td>
                <td style="background: #F8F8F8;">{{item.saleFinishNum}}</td>
                <td v-if="item.saleTargetNum<=item.saleFinishNum"
                    style="background: #F8F8F8;">100%
                </td>
                <td v-else style="background: #F8F8F8;">
                    {{Math.floor((item.probability)/(item.saleTargetNum-item.saleFinishNum))}}%
                </td>
            </template>
        </tr>
        <tr>
            <td colspan="3">合计</td>
            <td>{{daQuObj.saleTargetNum}}</td>
            <td>{{daQuObj.count}}</td>
            <td>{{daQuObj.saleFinishNum}}</td>
            <td>{{Math.floor(daQuObj.probability)}}%</td>
        </tr>
        </tbody>
    </table>
   <!-- <table class="oa-table" v-if="buyDate=='目标'">
        <tbody>
        <tr v-for="(item,i) in listTarget">
            <template v-if="item.roleName=='区域经理'">
                <td class="lineOne" :rowspan="item.regionNamespan"
                    :class="{hidden: item.regionNamedis}"><span
                        style="text-align: center;width: 50px;border-top:none;">{{item.regionName.replace(/大区/g,'')}}</span>
                </td>
                <td class="lineOne" style="width: 71px;border-top:none;">
                    <span style="text-align: center;">{{item.userName}}</span>
                </td>
                <td style="width: 113px;border-top:none;">
                    {{Number(item.beginMonth.substring(5))}}、{{Number(item.middleMonth.substring(5))}}、{{Number(item.endMonth.substring(5))}}月
                </td>
                <td style="width: 45px;border-top:none;">{{item.saleTargetNum}}</td>
                <td style="width: 62px;border-top:none;">{{item.count}}</td>
                <td style="width: 68px;border-top:none;">{{item.saleFinishNum}}</td>
                <td style="width: 45px;border-top:none;">{{Math.floor(item.probability)}}%</td>
            </template>
            <template v-else>
                <td class="lineOne" :rowspan="item.regionNamespan" style="width: 50px;border-top:none;"
                    :class="{hidden: item.regionNamedis}">
                    <span>{{item.regionName}}</span></td>
                <td class="lineOne" style="background: #F8F8F8;width: 71px;border-top:none;">
                    <span style="text-align: center;">{{item.userName}}</span>
                </td>
                <td style="background: #F8F8F8;width:113px;border-top:none;">
                    {{Number(item.beginMonth.substring(5))}}月
                </td>
                <td style="background: #F8F8F8;width: 45px;border-top:none;">{{item.saleTargetNum}}</td>
                <td style="background: #F8F8F8;width: 62px;border-top:none;">{{item.count}}</td>
                <td style="background: #F8F8F8;width: 68px;border-top:none;">{{item.saleFinishNum}}</td>
                <td v-if="item.saleTargetNum<=item.saleFinishNum"
                    style="background: #F8F8F8;width: 45px;border-top:none;">100%
                </td>
                <td v-else style="background: #F8F8F8;width: 45px;border-top:none;">
                    {{Math.floor((item.probability)/(item.saleTargetNum-item.saleFinishNum))}}%
                </td>
            </template>
        </tr>
        <tr>
            <td style="border-top:none;" colspan="3">合计</td>
            <td style="border-top:none;">{{daQuObj.saleTargetNum}}</td>
            <td style="border-top:none;">{{daQuObj.count}}</td>
            <td style="border-top:none;">{{daQuObj.saleFinishNum}}</td>
            <td style="border-top:none;">{{Math.floor(daQuObj.probability)}}%</td>
        </tr>
        </tbody>
    </table>-->
    <!--本年目标完成情况-->
    <table class="oa-table " v-if="buyDate=='目标'" style="margin-top: 55px">
        <thead>
        <tr class="oa-table-title">
            <th>本年目标及完成情况</th>
        </tr>
        </thead>
    </table>
    <table class="oa-table " v-if="buyDate=='目标'">
        <thead>
        <tr class="oa-table-title-gray">
            <td  style="width: 25%;background-color: #f8f8f8;border-top:none;">大区</td>
            <td  style="width: 25%;background-color: #f8f8f8;border-top:none;">姓名</td>
            <td  style="width: 25%;background-color: #f8f8f8;border-top:none;">目标</td>
            <td  style="width: 25%;background-color: #f8f8f8;border-top:none;">已完成</td>
        </tr>

        </thead>
    </table>
    <table class="oa-table" v-if="buyDate=='目标'">
        <tbody>
        <tr v-for="(item,i) in listTarget">
            <template v-if="item.roleName=='区域经理'">
                <td class="lineOne" :rowspan="item.regionNamespan"
                    :class="{hidden: item.regionNamedis}" style="border-top:none;"><span
                        style="text-align: center;">{{item.regionName}}</span></td>
                <td class="lineOne" style="border-top:none;">
                    <span style="text-align: center;">{{item.userName}}</span>
                </td>
                <td style="border-top:none;">{{item.yearTargetNum}}</td>
                <td style="border-top:none;">{{item.yearFinishNum}}</td>
            </template>
            <template v-else>
                <td class="lineOne" :rowspan="item.regionNamespan"
                    :class="{hidden: item.regionNamedis}"><span
                        style="text-align: center;border-top:none">{{item.regionName}}</span></td>
                <td class="lineOne" style="background: #F8F8F8;border-top:none">
                    <span style="text-align: center;">{{item.userName}}</span>
                </td>
                <td style="background: #F8F8F8;border-top:none">{{item.yearTargetNum}}</td>
                <td style="background: #F8F8F8;border-top:none">{{item.yearFinishNum}}</td>
            </template>
        </tr>
        <tr>
            <td style="border-top:none;" colspan="2">合计</td>
            <td style="border-top:none;">{{daQuObj.yearTargetNum}}</td>
            <td style="border-top:none;"> {{daQuObj.yearFinishNum}}</td>
        </tr>
        </tbody>
    </table>

    <!--全部-->
    <table class="oa-table " v-if="buyDate!='目标'" style="margin-top: 55px">
        <thead>
        <tr class="oa-table-title-gray">
            <td  style="width: 12%;background-color: #f8f8f8;">大区</td>
            <td  style="width: 14%;line-height:16px;background-color: #f8f8f8;">区域<br>经理</td>
            <td  style="width: 14%;background-color: #f8f8f8;">客户</td>
            <td  style="width: 15%;background-color: #f8f8f8;">意向机型</td>
            <td  style="width: 13%;line-height:16px;background-color: #f8f8f8;">成交<br>时间</td>
            <td  style="width: 12%;line-height:16px;background-color: #f8f8f8;">成交<br>概率</td>
        </tr>
        </thead>
    </table>
    <table class="oa-table">
        <tbody>
        <tr v-for="(item,i) in all">
            <td class="shuText" :rowspan="item.regionNamespan"  style="width: 12%;border-top:none;"
                :class="{hidden: item.regionNamedis}"><span style="text-align: center;">{{item.regionName.replace(/大区/g,'')}}</span><br/>
                <div class="oa-name" :style="item.bigRegionManagerName?'':'height:0px'">
                    {{item.bigRegionManagerName}}
                </div>
            </td>
            <td :rowspan="item.genZRspan" :class="{hidden: item.genZRdis}" style="width: 14%;border-top:none;">
                <div class="oa-name">{{item.genZR}}</div>
            </td>
            <td style="color: #2a8cec;overflow:hidden;width: 14%;border-top:none;"
                @click="openDetail(item.customerId,0,'look')">
                <div class="oa-name">
                    {{item.customerName.substring(0,item.customerName.length>4?4:item.customerName.length)}}
                </div>
            </td>
            <td class="lineOne" style="width: 15%;border-top:none;"><span>{{item.intentionModel}}</span></td>
            <td style="width: 13%;border-top:none;"><span class="lineOne">{{item.buyDate}}</span></td>
            <td v-if="item.chance" style="width: 12%;border-top:none;">{{item.chance}}</td>
            <td v-else style="width: 12%;border-top:none;"><50%</td>
        </tr>
        <tr v-if="returnFlag" >
            <td style="margin: 0 auto;color: #999999;text-align: center;padding: 32px;font-size: 16px;background: #fff;border-top: none"
                 v-if="!all ||all.length<=0">
                暂无意向客户
            </td>
        </tr>
        </tbody>
    </table>
</div>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script src="https://file.ggxqce.com/web/axios.min.js"></script>
<script src="/dist/js/newOaApp.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    //navigateBack回调
    function onParamReceived(param) {
        if (param) {
            if (app.buyDate == '目标') {
                app.getTarget();
            } else if (app.buyDate == '全部') {
                app.getAll();
            } else {
                app.get_customerList_regionManager();
            }
        }
    }

</script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            userId: getUrlParamObj().userId,
            companyId: getUrlParamObj().companyId,
            userInfo: {},
            regionId: getUrlParamObj().regionId ? getUrlParamObj().regionId : '',
            key: '',
            all: [],
            list1: [],
            list2: [],
            list3: [],
            list4: [],
            listLost: [],
            listDone: [],
            listTarget: [],
            daQuObj: {
                "saleTargetNum": 0,
                "count": 0,
                "saleFinishNum": 0,
                "probability": 0,
                "yearTargetNum": 0,
                "yearFinishNum": 0,
            },
            buyDate:getUrlParamObj().buyDate?getUrlParamObj().buyDate: '本月内',
            beginMonth: '',
            middleMonth: '',
            endMonth: '',
            customerList: [],
            returnFlag: false
        },
        methods: {
            //合计
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number += (arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0)

                }
                return number;
            },
            //合并单元格
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                if (field == 'regionId') {
                                    if (list[k].regionId == list[i].regionId) {
                                        list[k][field + 'span']++;
                                        list[k][field + 'dis'] = false;
                                        list[i][field + 'span'] = 1;
                                        list[i][field + 'dis'] = true;
                                    }
                                } else {
                                    list[k][field + 'span']++;
                                    list[k][field + 'dis'] = false;
                                    list[i][field + 'span'] = 1;
                                    list[i][field + 'dis'] = true;
                                }
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
            //本月目标、本年目标
            getTarget: function () {
                var that = this;
                that.showLoading();
                axios.post(urlConfig.intentionCustomerManagement.getManagerTarget,  {
                    "userId": that.userId
                })
                    .then(function (data) {
                        that.listTarget = that.tablesMergeCell(data.records);
                        var dqnum = 0;
                        var dqnum1 = 0;
                        var dqnum2 = 0;
                        var dqnum3 = 0;
                        var dqnum4 = 0;
                        for (var i = 0; i < that.listTarget.length; i++) {
                            if (that.listTarget[i].roleName == '大区经理') {
                                var roleId = that.listTarget[i].regionId;
                                var num = 0;
                                var num1 = 0;
                                var num2 = 0;
                                var num3 = 0;
                                var num4 = 0;
                                for (var a = 0; a < that.listTarget.length; a++) {
                                    if (that.listTarget[a].regionId == roleId) {
                                        num += that.listTarget[a].count;
                                        num1 += that.listTarget[a].saleFinishNum;
                                        num2 += Number(that.listTarget[a].probability);
                                        num3 += Number(that.listTarget[a].yearTargetNum);
                                        num4 += Number(that.listTarget[a].yearFinishNum);
                                    }
                                }
                                that.listTarget[i].count = num;
                                dqnum += num;
                                that.listTarget[i].saleFinishNum = num1;
                                dqnum1 += num1;
                                that.listTarget[i].probability = num2;
                                dqnum2 += num2;
                                that.listTarget[i].yearTargetNum = num3;
                                dqnum3 += num3;
                                that.listTarget[i].yearFinishNum = num4;
                                dqnum4 += num4;
                            }
                        }
                        //最大的合计
                        that.daQuObj.saleTargetNum = that.getCount(that.listTarget, "saleTargetNum");
                        that.daQuObj.count = dqnum;
                        that.daQuObj.saleFinishNum = dqnum1;
                        that.daQuObj.probability = Math.floor(dqnum2);
                        that.daQuObj.yearTargetNum = dqnum3;
                        that.daQuObj.yearFinishNum = dqnum4;
                        that.hideLoading()
                    })
            },
            getAll: function () {
                var that = this;
                that.showLoading();
                axios.post(urlConfig.intentionCustomerManagement.getIntentCustomerListForManagerByUserId,  {
                    "userId": that.userId,
                    "companyId": that.companyId,
                    "buyDate": '',
                    "key": that.key
                })
                    .then(function (data) {

                        for (var i = 0; i < data.list.length; i++) {
                            for (var j = 0; j < data.report.length; j++) {
                                if ((data.report[j].regionId == data.list[i].regionId)) {
                                    data.list[i].bigRegionManagerName = data.report[j].bigRegionManagerName
                                }
                            }
                        }
                        that.all = that.tablesMergeCell(data.list);
                         that.hideLoading();
                    })
            },
            //获取七天内等
            get_customerList_regionManager: function () {
                var that = this;
                that.showLoading()
                axios.post(urlConfig.intentionCustomerManagement.getIntentCustomerListForManagerByUserId, {
                    "companyId": that.companyId,
                    "userId": that.userId,
                    "buyDate": that.buyDate,
                    "key": that.key
                })
                    .then(function (data) {
                        console.log(data.list)
                        for (var i = 0; i < data.list.length; i++) {
                            for (var j = 0; j < data.report.length; j++) {
                                if ((data.report[j].regionId == data.list[i].regionId)) {
                                    data.list[i].bigRegionManagerName = data.report[j].bigRegionManagerName
                                }
                            }
                        }
                        var list = data.list;
                        that.all = that.tablesMergeCell(list);
                        that.hideLoading()
                        that.returnFlag = true;
                    })
            },
            //打开客户详情
            openDetail: function (customerId, isAdd, pageType) {
                var isRegion = ''
                if (this.isSelf == 1) {
                    pageType = "edit"
                    isRegion = 1
                }
                var that = this;
                var param = {
                    url:'/page/intentionManagement/quYuIntentionalDetailApp.html?customerId=' + customerId + '&isAdd=' + isAdd + '&pageType=' + pageType + '&userId=' + that.userId + '&companyId=' + that.companyId + '&isRegion=' + isRegion + '&isSelf=' + that.isSelf+"&newPager=1",
                }
                JSBridge.call(ROUTER, 'navigateTo', param)
            },
            setPullRefresh: function(isOpen) {
                var param = {
                    pullRefresh: isOpen, //是否开启原生下拉刷新
                }
                JSBridge.call(UI, 'setPullRefresh', param)
            },
            showLoading: function () {
                var that = this
                var param = {
                    cancelable: false
                }
                JSBridge.call(UI, 'showLoading', param)
            },
            hideLoading: function () {
                JSBridge.call(UI, 'hideLoading');
            },

        },
        mounted: function () {
            var that = this;
            that.showLoading()
            that.setPullRefresh(true)
            axios.post(urlConfig.system.user.getUserViewById, {
                "id": that.userId
            })
                .then(function (data) {
                    console.log(data)
                    that.userInfo = data;
                   /* if (!that.companyId) {
                     that.companyId = that.userInfo.companyId
                     }*/
                    console.log('companyId=' + that.companyId)
                })
            if (that.buyDate == '目标') {
                that.getTarget();
            } else if (that.buyDate == '全部') {
                that.getAll();
            } else {
                that.get_customerList_regionManager();
            }

        }
    })
</script>
<script>
    var isTop = true
    $(window).scroll(function () {
        //为了保证兼容性，这里取两个值，哪个有值取哪一个,scrollTop就是触发滚轮事件时滚轮的高度
        var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
        if (scrollTop === 0) {
            isTop = true
            setScrollTop(true) //到达顶部
        } else if (scrollTop > 0 && isTop) {
            isTop = false
            setScrollTop(false) //非顶部
        }
    })
    function setScrollTop (isScrollTop) {
        var param = {
            isScrollTop: isScrollTop
        }
        JSBridge.call(UI, 'setScrollTop', param)
    }

</script>
</body>
</html>